﻿using CodeCreator;
using CodeTemplate.DbHelper.CoreObj;
using System;
using System.Collections.Generic;
using System.Text;

namespace iBing.Common.DbHelper.CoreObj
{
    public class Obj
    {
        public Obj() { }
        private string packageName;//com.inspur.plugins
        private string pluginName;//test
        private string javaClassName;//ClassName
        private string javaObjName;//className
        private string javaPkName;//Id
        private string jsClassName;//ClassName
        private string jsObjName;//classname
        private string jsPkFieldName;//id
        private string dbSchemaName;//SCHEMA
        private string dbTableName;//CLASS_NAME
        private string dbSequenceName;//SEQ_CLASS_NAME
        private string dbPkFieldName;//ID
        private List<DbField> dbFields = new List<DbField>();
        private List<ObjJavaField> javaFields = new List<ObjJavaField>();
        private List<ObjJsField> jsFields = new List<ObjJsField>();
        private List<ObjForSql> sqls = new List<ObjForSql>();
        private List<ObjForQuery> conditions = new List<ObjForQuery>();


        #region 内部属性

        public string JavaObjName
        {
            get { return javaObjName; }
            set { javaObjName = value; }
        }

        public string JsObjName
        {
            get { return jsObjName; }
            set { jsObjName = value; }
        }

        public List<ObjForQuery> Conditions
        {
            get { return conditions; }
            set { conditions = value; }
        }

        public List<ObjForSql> Sqls
        {
            get { return sqls; }
            set { sqls = value; }
        }

        public List<ObjJsField> JsFields
        {
            get { return jsFields; }
            set { jsFields = value; }
        }

        public List<ObjJavaField> JavaFields
        {
            get { return javaFields; }
            set { javaFields = value; }
        }

        public List<DbField> DbFields
        {
            get { return dbFields; }
            set { dbFields = value; }
        }

        public string DbPkFieldName
        {
            get { return dbPkFieldName; }
            set { dbPkFieldName = value; }
        }

        public string DbSequenceName
        {
            get { return dbSequenceName; }
            set { dbSequenceName = value; }
        }

        public string DbTableName
        {
            get { return dbTableName; }
            set { dbTableName = value; }
        }

        public string DbSchemaName
        {
            get { return dbSchemaName; }
            set { dbSchemaName = value; }
        }

        public string JsPkFieldName
        {
            get { return jsPkFieldName; }
            set { jsPkFieldName = value; }
        }

        public string JsClassName
        {
            get { return jsClassName; }
            set { jsClassName = value; }
        }

        public string JavaPkName
        {
            get { return javaPkName; }
            set { javaPkName = value; }
        }

        public string JavaClassName
        {
            get { return javaClassName; }
            set { javaClassName = value; }
        }

        public string PluginName
        {
            get { return pluginName; }
            set { pluginName = value; }
        }


        public string PackageName
        {
            get { return packageName; }
            set { packageName = value; }
        }
        #endregion

        #region 扩展属性
        public string DbTableFullName
        {
            get
            {
                if (this.DbSchemaName != null && this.DbSchemaName != "")
                    return this.DbSchemaName + "." + this.DbTableName;
                else
                    return this.DbTableName;
            }
        }
        #endregion
    }
}
